define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.finance_day/index',
        add_url: 'system.finance_day/add',
        edit_url: 'system.finance_day/edit',
        delete_url: 'system.finance_day/delete',
        export_url: 'system.finance_day/jsExport',
        modify_url: 'system.finance_day/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'date', title: 'date'},
                    {field: 'income', title: 'income'},
                    {field: 'expend', title: 'expend'},
                    {field: 'cashcard_use', title: 'cashcard_use'},
                    {field: 'user_consume', title: 'user_consume'},
                    {field: 'user_refund', title: 'user_refund'},
                    {field: 'create_time', title: 'create_time'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});